<?php
/*------------------------------------------------------------------------
# company - company management 
# @author    pipapai.com
-------------------------------------------------------------------------*/

defined('_JEXEC') or die;
// disable core styles to avoid bs conflict 
OC_Util::$core_styles = array();

if(isDevMode()) {
   OCP\Util::addStyle('company', 'company');
   OCP\Util::addScript('company', 'license');
} else {
   OCP\Util::addStyle('static', 'company');
   OCP\Util::addScript('static', 'apps/company.license.min');
}

OCP\App::setActiveNavigationEntry('company_settings');

$lang = PFactory::getLanguage();
$lang->load("com_jobs", JPATH_SITE, "zh-CN");

$user = $_['user']; 

?>

<script type="text/javascript" src="<?php print_unescaped(OC_Helper::linkTo('company/js', 'company.php'));?>"></script>

<div class="hr_inner_navigate clearfix">
   <ul class="clearfix">
      <?php PCompanyHelper::showNavigationMenu($_['masteruser'], 'license');?>
   </ul>
</div>

<div class="hr_company_set span9 leftpad">
   <div class="licenseform">
      <?php if($_['masteruser']): ?>
         <?php if($user->validated == EMPLOYER_NOT_VALIDATED): ?>
         <div class="licensealert_normal yahei">请先进行公司验证，通过后即可使用云招聘的全部功能！</div>
         <?php elseif($user->validated == EMPLOYER_VALIDATED): ?>
         <div class="licensealert_success yahei">您的公司已通过验证。如有变更，请上传您最新年检的营业执照副本。</div>
         <?php elseif($user->validated == EMPLOYER_VALIDATING): ?>
         <div class="licensealert_goning yahei">您公司的验证正在进行中，请等待一个工作日完成验证。</div>
         <?php elseif($user->validated == EMPLOYER_FAIL_VALIDATION): ?>
         <div class="licensealert_error yahei">您公司的验证失败: <?php echo $user->validate_msg; ?></div>
         <?php endif; ?>
      <?php endif; ?>
         
      <div class="tips">通过公司验证是获得广大人才应聘者信任的重要一环。<br/>请准备好您公司的<em>最新年检的营业执照副本</em>，点击下面的按钮上传。<br/><span>(支持最大4Ｍ的Word,PDF,JPG,PNG格式)</span></div>
      
      <div class="tips approve_tips normal">
         <div id="uploadlicenseform" class="uploadform">
            <form id="uploadform" class="file_upload" action="<?php echo OC_Helper::linkToRoute('company_uploadlicense');?>" method="POST" enctype="multipart/form-data">
               <div class="uploadbtn">
                  <input class="inputfile" type="file" name="Filedata"/>
                  <div class="btn-upload large" data-nodragtext="选择营业执照副本上传">选择或拖拽营业执照副本至该区域上传</div>
               </div>
               <input type="hidden" name="requesttoken" value="<?php echo $_['requesttoken'] ?>" id="requesttoken">
             </form>
   
             <table class="files">
                <tr class="file_upload_template" style="display:none;">
                   <td class="file_name" width="240"></td>
                   <td class="file_size"></td>
                   <td class="file_upload_progress"><div></div></td>
                   <td class="file_upload_start"><button class="btn btn-info">开始上传</button></td>
                </tr>
             </table>
         </div>
      </div>
   
      <!-- 上传公司认证文件第三步 -->
      <div id='successmsg'> 
      	<div class="success"><img src="/images/3/up_success.png"/></div>
         <div class="tips approve_tips approve_tips_width normal">感谢您的信任，我们将及时验证您的营业执照，一旦通过，我们将及时通知您。请耐心等待！</div>
      </div>
   </div>
</div>
